﻿<!DOCTYPE html>
<html>
	<head>
		<title>REPLACE/REPLACEB Function</title>
		<meta charset="utf-8" />
		<meta name="description" content="" />
		<link type="text/css" rel="stylesheet" href="../../../../../../common/main/resources/help/editor.css" />
		<link type = "text/css" rel = "stylesheet" href = "../../images/sprite.css" />
        <script type="text/javascript" src="../callback.js"></script>
        <script type="text/javascript" src="../search/js/page-search.js"></script>
	</head>
	<body>
		<div class="mainpart">
            <div class="search-field">
                <input id="search" class="searchBar" placeholder="Search" type="text" onkeypress="doSearch(event)">
            </div>
			<h1>REPLACE/REPLACEB Function</h1>
			<p>The <b>REPLACE/REPLACEB</b> function is one of the <a href="../UsageInstructions/InsertFunction.htm#textdata" onclick="onhyperlinkclick(this)">text and data functions</a>. Is used to replace a set of characters, based on the number of characters and the start position you specify, with a new set of characters. The <b>REPLACE</b> function is intended for languages that use the single-byte character set (SBCS), while <b>REPLACEB</b> - for languages that use the double-byte character set (DBCS) like Japanese, Chinese, Korean etc.</p>
			<h3>Syntax</h3> 
			<p><b><em>REPLACE(old_text, start_num, num_chars, new_text)</em></b></p> 
			<p>The <b>REPLACE</b> function has the following arguments:</p> 
			<table style="width: 40%">
                <tr>
                    <th style="background-color: #f4f4f4" width="150ch"><b>Argument</b></th>
                    <th style="background-color: #f4f4f4"><b>Description</b></th>
                </tr>
                <tr>
                    <td><b><em>old_text</em></b></td>
                    <td>The original text to be replaced.</td>
                </tr>
				<tr>
                    <td><b><em>start_num</em></b></td>
                    <td>The beginning of the set to be replaced.</td>
                </tr>
				<tr>
                    <td><b><em>num_chars</em></b></td>
                    <td>The number of characters to be replaced.</td>
                </tr>
				<tr>
                    <td><b><em>new_text</em></b></td>
                    <td>The new text.</td>
                </tr>
            </table>

            <p><b><em>REPLACEB(old_text, start_num, num_bytes, new_text)</em></b></p>
            <p>The <b>REPLACEB</b> function has the following arguments:</p>
            <table style="width: 40%">
                <tr>
                    <th style="background-color: #f4f4f4" width="150ch"><b>Argument</b></th>
                    <th style="background-color: #f4f4f4"><b>Description</b></th>
                </tr>
                <tr>
                    <td><b><em>old_text</em></b></td>
                    <td>The original text to be replaced.</td>
                </tr>
                <tr>
                    <td><b><em>start_num</em></b></td>
                    <td>The beginning of the set to be replaced.</td>
                </tr>
                <tr>
                    <td><b><em>num_bytes</em></b></td>
                    <td>The number of characters to be replaced, based on bytes.</td>
                </tr>
                <tr>
                    <td><b><em>new_text</em></b></td>
                    <td>The new text.</td>
                </tr>
            </table>
			<h3>Notes</h3>
			<p>The REPLACE function is <b>case-sensitive</b>.</p>
			<p><a href="../UsageInstructions/InsertFunction.htm#applyfunction" onclick="onhyperlinkclick(this)">How to apply</a> the <b>REPLACE/REPLACEB</b> function.</p>
			
			<h3>Examples</h3>
            <p>The figure below displays the result returned by the <b>REPLACE</b> function.</p>
			<p><img alt="REPLACE Function" src="../images/replace.png" /></p>
		</div>
	</body>
</html>